//
//  CodeViewController.m
//  ShrimpCrowdordering
//
//  Created by 郑洲 on 2018/8/6.
//  Copyright © 2018年 郑洲. All rights reserved.
//

#import "CodeViewController.h"

@interface CodeViewController ()

@end

@implementation CodeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.title = @"二维码";
    [self setUI];
}

- (void)setUI {
    UIImageView *bgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - NAVIGATION_BAR_HEIGHT)];
    [bgView sd_setImageWithURL:[NSURL URLWithString:_backGround] placeholderImage:nil options:SDWebImageRetryFailed];
    bgView.clipsToBounds = YES;
    bgView.contentMode = UIViewContentModeScaleAspectFill;
    [self.view addSubview:bgView];
    
    UIView *codeBg = [[UIView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH - ScreenX375(274)) / 2, ScreenX375(128), ScreenX375(274), ScreenX375(300))];
    codeBg.backgroundColor = [UIColor colorWithWhite:1 alpha:0.9];
    codeBg.layer.cornerRadius = ScreenX375(5);
    codeBg.clipsToBounds = YES;
    codeBg.layer.shadowColor = RGB_COLOR(25, 25, 25).CGColor;
    codeBg.layer.shadowOpacity = 0.25;
    codeBg.layer.shadowOffset = CGSizeMake(0, 1);
    codeBg.layer.shadowRadius = 15;
    [self.view addSubview:codeBg];
    
    UIImageView *code = [[UIImageView alloc] initWithFrame:CGRectMake(ScreenX375(40), ScreenX375(35), ScreenX375(194), ScreenX375(194))];
    [code sd_setImageWithURL:kNSUDefaultReadKey(@"qrCode") placeholderImage:nil options:SDWebImageRetryFailed];
    [codeBg addSubview:code];
    
    UILabel *noteLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, ScreenX375(250), ScreenX375(274), ScreenX375(15))];
    noteLabel.text = @"扫一扫上面的二维码图案，加我好友";
    noteLabel.textAlignment = NSTextAlignmentCenter;
    noteLabel.font = Kfont(13);
    noteLabel.textColor = REXADECIMALCOLOR(@"#333333");
    [codeBg addSubview:noteLabel];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
